﻿define([],function(){
    
    console.log("mock-data");
    
    if (typeof COMM_DATA == 'undefined') {
        var COMM_DATA = {
            topObj : {
                loginFlag : "1", // 0：未登录， 1：已登录
                welcome_txt : "111欢迎来到咖啡集散交易中心平台",
                login_href : "#1adfsasdf",
                register_href : "#3",
                username : "张三",
                order_href : "#myorder",
                buyer_center_href : "#buyercenter",
                logout_href : "#logout",
            },
            searchObj : {
                web_logo_img : "../../resouce/css/images/b2b-web-logo.jpg",
                home_url : "#3",
                hot_words : [{
                        href_val : "#4",
                        word_txt : "咖啡豆"
                    }, {
                        href_val : "#5",
                        word_txt : "咖啡供应"
                    }, {
                        href_val : "#6",
                        word_txt : "咖啡机2"
                    }
                ],
                d_code_img : "../../resouce/css/images/d-code.jpg"
            },
            mainNavObj : [{
                    href_val : "#10",
                    href_txt : "首页",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "自由集散区",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "供采分销区",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "供应报盘",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "采购询盘",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "商家中心",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "行业资讯",
                    new_flag : false
                }, {
                    href_val : "#10",
                    href_txt : "物流服务",
                    new_flag : true
                }, {
                    href_val : "#10",
                    href_txt : "金融服务",
                    new_flag : true
                }
            ],
            
            footNavObj : [{
                    item_desc : "新手指南",
                    item_list : [{
                            href_val : "#20",
                            href_txt : "免费注册"
                        }, {
                            href_val : "#20",
                            href_txt : "了解平台"
                        }, {
                            href_val : "#20",
                            href_txt : "找回密码"
                        }, {
                            href_val : "#20",
                            href_txt : "客服中心"
                        }
                    ]
                }, {
                    item_desc : "交易关注",
                    item_list : [{
                            href_val : "#20",
                            href_txt : "发布询价"
                        }, {
                            href_val : "#20",
                            href_txt : "检索商品"
                        }, {
                            href_val : "#20",
                            href_txt : "采购商品"
                        }
                    ]
                }, {
                    item_desc : "采购商服务",
                    item_list : [{
                            href_val : "#20",
                            href_txt : "发布询价"
                        }, {
                            href_val : "#20",
                            href_txt : "检索商品"
                        }, {
                            href_val : "#20",
                            href_txt : "采购商品"
                        }
                    ]
                }, {
                    item_desc : "供应商服务",
                    item_list : [{
                            href_val : "#20",
                            href_txt : "发布供应"
                        }, {
                            href_val : "#20",
                            href_txt : "发布商品"
                        }, {
                            href_val : "#20",
                            href_txt : "在线交易"
                        }, {
                            href_val : "#20",
                            href_txt : "如何授权"
                        }
                    ]
                }, {
                    item_desc : "支付方式",
                    item_list : [{
                            href_val : "#20",
                            href_txt : "中信银行"
                        }, {
                            href_val : "#20",
                            href_txt : "银行在线支付"
                        }
                    ]
                }, {
                    item_desc : "平台服务",
                    item_list : [{
                            href_val : "#20",
                            href_txt : "物流服务"
                        }, {
                            href_val : "#20",
                            href_txt : "金融服务"
                        }
                    ]
                }
            ]
        };
        
        var USER_COMM_DATA = {
            leftNavObj : [{
                    title : "供求管理",
                    menuItems : [{
                            href_val : "#supply",
                            lbl_txt : "发布供应报盘",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "管理供应报盘",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "还盘意向单",
                        }
                    ]
                }, 
                {
                    title : "分销管理",
                    menuItems : [{
                            href_val : "#supply",
                            lbl_txt : "订单管理",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "我的采购商",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "审批采购商",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "价格策略组",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "管理分销关系",
                        }
                    ]
                }, 
                {
                    title : "店铺管理",
                    menuItems : [{
                            href_val : "#supply",
                            lbl_txt : "商品管理",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "分类管理",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "店铺设置",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "巡航设置",
                        },
                    ]
                }, 
                {
                    title : "账户中心",
                    menuItems : [{
                            href_val : "#supply",
                            lbl_txt : "账户首页",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "公司资料",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "修改密码",
                        }, {
                            href_val : "#supply",
                            lbl_txt : "短消息",
                        }
                    ]
                }
            ]
        };
        
    }
    
    
    // 省
    $.mockjax({
        url : "/addressinfo",
        type : "post", // post, get
        data : {
            addrType : "0"
        },
        // You may need to include the [json2.js]
        // (https://raw.github.com/douglascrockford/JSON-js/master/json2.js) library
        // for older browsers
        responseText : {
            state : "1",
            data : [{
                    code : '100',
                    content : '北京市'
                }, {
                    code : '101',
                    content : '天津市'
                }, {
                    code : '102',
                    content : '上海市'
                }, {
                    code : '103',
                    content : '重庆市'
                }, {
                    code : '104',
                    content : '云南省'
                }, {
                    code : '105',
                    content : '四川省'
                }
            ]
        }
    });
    
    // 市
    $.mockjax({
        url : "/addressinfo",
        type : "post", // post, get
        data : {
            addrType : "1"
        },
        // You may need to include the [json2.js]
        // (https://raw.github.com/douglascrockford/JSON-js/master/json2.js) library
        // for older browsers
        responseText : {
            state : "1",
            data : [{
                    code : '200',
                    content : '昆明市'
                }, {
                    code : '201',
                    content : '玉溪市'
                }, {
                    code : '202',
                    content : '丽江市'
                }, {
                    code : '203',
                    content : '大理市'
                }
            ]
        }
    });
    
    // 区县
    $.mockjax({
        url : "/addressinfo",
        type : "post", // post, get
        data : {
            addrType : "2"
        },
        // You may need to include the [json2.js]
        // (https://raw.github.com/douglascrockford/JSON-js/master/json2.js) library
        // for older browsers
        responseText : {
            state : "1",
            data : [{
                    code : '200',
                    content : '渝中区'
                }, {
                    code : '201',
                    content : '渝北区'
                }, {
                    code : '202',
                    content : '沙坪坝区'
                }, {
                    code : '203',
                    content : '北碚区'
                }, {
                    code : '204',
                    content : '南岸区'
                }, {
                    code : '205',
                    content : '璧山县'
                },
            ]
        }
    });
    
    // 主营类别
    $.mockjax({
        url : PAGE_CONFIG.requestUrl.categoryUrl, // "/category" PAGE_CONFIG.requestUrl.categoryUrl
        type : "post", // post, get
        responseText : {
            state : "1",
            data : [{
                    categTitle : "咖啡器皿",
                    categDetail : [{
                            
                            txt : "1咖啡生豆",
                            code : "100"
                        }, {
                            
                            txt : "2咖啡熟豆",
                            code : "101"
                        }, {
                            
                            txt : "3烘焙咖啡豆",
                            code : "102"
                        }
                    ]
                }, {
                    categTitle : "进口咖啡",
                    categDetail : [{
                            
                            txt : "1ka",
                            code : "103"
                        }
                    ]
                }, {
                    categTitle : "咖啡物料/咖啡饮品",
                    categDetail : [{
                            
                            txt : "xxx",
                            code : "104"
                        }
                    ]
                }, {
                    categTitle : "家庭办公室制作器具",
                    categDetail : [{
                            
                            txt : "家庭办公1",
                            code : "105"
                        }
                    ]
                }, {
                    categTitle : "咖啡制作辅助用品",
                    categDetail : [{
                            
                            txt : "咖啡制作1",
                            code : "106"
                        }, {
                            
                            txt : "咖啡制作2",
                            code : "107"
                        }
                    ]
                }, {
                    categTitle : "商用咖啡制作器具",
                    categDetail : [{
                            
                            txt : "商用咖啡制作1",
                            code : "108",
                        }
                    ]
                }, {
                    categTitle : "咖啡加工生产设备",
                    categDetail : [{
                            
                            txt : "咖啡加工1",
                            code : "109"
                        }
                    ]
                }, {
                    categTitle : "咖啡厅辅助设备",
                    categDetail : [{
                            
                            txt : "咖啡厅辅助1",
                            code : "110"
                        }
                    ]
                }
            ]
        }
    });
    
    // 主营品牌
    $.mockjax({
        url : PAGE_CONFIG.requestUrl.brandUrl, // "/brand",
        type : "post", // post, get
        responseText : {
            state : "1",
            data : [{
                    categTitle : "一类品牌",
                    categDetail : [{
                            
                            txt : "后谷咖啡",
                            code : "100"
                        }, {
                            
                            txt : "重庆咖啡",
                            code : "101"
                        }, {
                            
                            txt : "云南咖啡",
                            code : "102"
                        }
                    ]
                }, {
                    categTitle : "二类品牌",
                    categDetail : [{
                            
                            txt : "贵阳咖啡",
                            code : "103"
                        }, {
                            
                            txt : "雀巢咖啡",
                            code : "104"
                        }, {
                            
                            txt : "aa咖啡",
                            code : "105"
                        }
                    ]
                }
            ]
        }
    });

    // 地址-省;
    $.mockjax({
        url : PAGE_CONFIG.requestUrl.addrProvince,
        type : "post", // post, get
        responseText : {
            data : [ 
            {code:"200", text: "北京市"},
            {code:"201", text: "重庆市"},
            {code:"202", text: "上海市"},
            {code:"203", text: "云南省"},
            ]
        }
    });

    // 地址-市;
    $.mockjax({
        url : PAGE_CONFIG.requestUrl.addrCity,
        type : "post", // post, get
        responseText : {
            data : [ 
            {code:"200", text: "万州市"},
            {code:"201", text: "重庆市"},
            {code:"202", text: "昆明市"},
            ]
        }
    });
    
    // 地址-区/县;
    $.mockjax({
        url : PAGE_CONFIG.requestUrl.addrCounty,
        type : "post", // post, get
        responseText : {
            data : [ 
            {code:"200", text: "江北区"},
            {code:"201", text: "北碚区"},
            {code:"202", text: "xx县"}
            ]
        }
    });    
    
    window.COMM_DATA = COMM_DATA;
    
});